switchroot: Replace custom error printing with err/warn functions from libc
authorWilliam Manley <will@williammanley.net>
Tue, 30 Aug 2016 21:36:20 +0000 (22:36 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 30 Aug 2016 22:41:27 +0000 (22:41 +0000)
commita128abd9bcf9842ae7cd61ef951b5345573c3df6
tree8962d85d785a94bcabffe0dfdde6af75ca4f8a21
parent42dab85728385eaf538b36ed56e9db7ff3f96faa
switchroot: Replace custom error printing with err/warn functions from libc

The `warn()` libc extension has exactly the same behaviour as our own
`perrorv` function, but is available in (at least) glibc and musl.  As an
added bonus the similar function `err()` which will exit with an error
code afterwards.

This implementation is tidier and allows us to get rid of our own
`perrorv`.  It paves the way to removing `ostree-mount-util.c` to simplify
the build scripts.

Original idea by @cgwalters in #477.

Closes: #478
Approved by: cgwalters
src/switchroot/ostree-mount-util.c
src/switchroot/ostree-mount-util.h
src/switchroot/ostree-prepare-root.c
src/switchroot/ostree-remount.c